package com.jiazhong.controller;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(value = "/web", loadOnStartup = 1)
public class FirstController extends HttpServlet {

    static {
        System.out.println("FirstController 被加载了");
    }

    public FirstController() {
        System.out.println("产生了FirstController 的对象");
    }

    @Override
    public void init(ServletConfig config) throws ServletException {
        System.out.println("FirstController init");
    }

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("FirstController service");
    }

    @Override
    public void destroy() {
        System.out.println("FirstController destroy");
    }
}
